package com.ithema;

import java.util.Random;
import java.util.Scanner;

public class Demo01GuessNum {
    public static void main(String[] args) {
        Random r = new Random();
        int gussnum = r.nextInt(100) + 1;
        Scanner sc = new Scanner(System.in);
        System.out.println("请输入你猜测的数值");
        while (true) {

            int inputnum = sc.nextInt();
            if (inputnum > gussnum) {
                System.out.println("你猜测的数值大了");
            } else if (inputnum < gussnum) {
                System.out.println("你输入的数值小了");
            } else {
                System.out.println("恭喜你猜对了");
                break;
            }

        }
    }
}
